//
//  NewsTableViewCell.m
//  AndCampus
//
//  Created by 史宵宵 on 2017/12/7.
//  Copyright © 2017年 史宵宵. All rights reserved.
//

#import "NewsTableViewCell.h"

@implementation NewsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setNewsInfo:(NewsInfo *)newsInfo{
    if (strIsEmpty(newsInfo.friend_id)) {
        self.iconImage.image = [UIImage imageNamed:newsInfo.icon];
    }else{
        [self.iconImage sd_setImageWithURL:[NSURL URLWithString:newsInfo.icon] placeholderImage:KDEFAULTHEAD];
    }
    
    if ([newsInfo.message_count isEqualToString:@"0"]) {
        self.newsNumLabel.hidden = YES;
    }else{
        self.newsNumLabel.hidden = NO;
        self.newsNumLabel.text = newsInfo.message_count;
    }
    self.newsTitle.text = newsInfo.name;
    self.newsDesLabel.text = newsInfo.show_text;
    self.newsTime.text = newsInfo.update_time;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
